<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <link rel='stylesheet' href='../css/github.css'>
    <style>
    body {
        font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
        font-size:14px;
        line-height: 1.42857143;
        color: #333;
        background-color:#fff;
        margin:0;
    }
    * {
        -webkit-box-sizing: border-box;
        -moz-box-sizing: border-box;
        box-sizing:border-box;
    }
    hr {
        height: 0;
        -webkit-box-sizing: content-box;
        -moz-box-sizing: content-box;
        box-sizing: content-box;
    }
    hr {
        margin-top: 20px;
        margin-bottom: 20px;
        border: 0;
        border-top: 1px solid #eee;
    }
    h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
        font-family: inherit;
        font-weight: 500;
        line-height: 1.1;
        color: inherit;
    }
    .container-fluid {
        padding-right: 15px;
        padding-left: 15px;
        margin-right: auto;
        margin-left: auto;
    }
    .page-header {
        padding-bottom: 9px;
        margin: 40px 0 20px;
        border-bottom: 1px solid #eee;
    }

    h1, .h1, h2, .h2, h3, .h3 {
        margin-top: 20px;
        margin-bottom: 10px;
    }
    h2, .h2 {
        font-size: 30px;
    }
    .row {
        margin-right: -15px;
        margin-left: -15px;
    }
    .col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {
        position: relative;
        min-height: 1px;
        padding-right: 15px;
        padding-left: 15px;
    }
    .col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 {
        float: left;
    }
    .col-xs-12 {
        width: 100%;
    }
    h3, .h3 {
        font-size: 24px;
    }
    .col-xs-6 {
        width: 50%;
    }

    pre {
        overflow: auto;
    }
    code, kbd, pre, samp {
        font-family: monospace,monospace;
        font-size: 1em;
    }
    code, kbd, pre, samp {
        font-family: Menlo,Monaco,Consolas,"Courier New",monospace;
    }
    pre {
        display: block;
        padding: 9.5px;
        margin: 0 0 10px;
        font-size: 13px;
        line-height: 1.42857143;
        color: #333;
        word-break: break-all;
        word-wrap: break-word;
        background-color: #f5f5f5;
        border: 1px solid #ccc;
        border-radius: 4px;
    }
    button, input, optgroup, select, textarea {
        margin: 0;
        font: inherit;
        color: inherit;
    }

    button {
        overflow: visible;
    }
    button, select {
        text-transform: none;
    }
    button, html input[type=button], input[type=reset], input[type=submit] {
        -webkit-appearance: button;
        cursor: pointer;
    }
    input {
        line-height: normal;
    }
    input, button, select, textarea {
        font-family: inherit;
        font-size: inherit;
        line-height: inherit;
    }
    .btn {
        display: inline-block;
        padding: 6px 12px;
        margin-bottom: 0;
        font-size: 14px;
        font-weight: 400;
        line-height: 1.42857143;
        text-align: center;
        white-space: nowrap;
        vertical-align: middle;
        cursor: pointer;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        background-image: none;
        border: 1px solid transparent;
        border-radius: 4px;
    }
    .btn-primary {
        color: #fff;
        background-color: #428bca;
        border-color: #357ebd;
    }
    .btn-danger {
        color: #fff;
        background-color: #d9534f;
        border-color: #d43f3a;
    }
    .btn-info {
        color: #fff;
        background-color: #5bc0de;
        border-color: #46b8da;
    }
    .btn-warning {
        color: #fff;
        background-color: #f0ad4e;
        border-color: #eea236;
    }
    .btn:hover, .btn:focus {
        color: #333;
        text-decoration: none;
    }
    .btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active, .open>.dropdown-toggle.btn-primary {
        color: #fff;
        background-color: #3071a9;
        border-color: #285e8e;
    }

    .btn-danger:hover, .btn-danger:focus, .btn-danger:active, .btn-danger.active, .open>.dropdown-toggle.btn-danger {
        color: #fff;
        background-color: #c9302c;
        border-color: #ac2925;
    }
    .btn-info:hover, .btn-info:focus, .btn-info:active, .btn-info.active, .open>.dropdown-toggle.btn-info {
        color: #fff;
        background-color: #31b0d5;
        border-color: #269abc;
    }
    .btn-warning:hover, .btn-warning:focus, .btn-warning:active, .btn-warning.active, .open>.dropdown-toggle.btn-warning {
        color: #fff;
        background-color: #ec971f;
        border-color: #d58512;
    }
    .pre-scrollable {
        max-height: 340px;
        overflow-y: scroll;
    }
    .panel {
        margin-bottom: 20px;
        background-color: #fff;
        border: 1px solid transparent;
        border-radius: 4px;
        -webkit-box-shadow: 0 1px 1px rgba(0,0,0,.05);
        box-shadow: 0 1px 1px rgba(0,0,0,.05);
    }
    .panel-info {
        border-color: #bce8f1;
    }
    .panel-heading {
        padding: 10px 15px;
        border-bottom: 1px solid transparent;
        border-top-left-radius: 3px;
        border-top-right-radius: 3px;
    }
    .panel-info>.panel-heading {
        color: #31708f;
        background-color: #d9edf7;
        border-color: #bce8f1;
    }
    .panel-title {
        margin-top: 0;
        margin-bottom: 0;
        font-size: 16px;
        color: inherit;
    }
    .panel-body {
        padding: 15px;
    }
    .panel-footer {
        padding: 10px 15px;
        background-color: #f5f5f5;
        border-top: 1px solid #ddd;
        border-bottom-right-radius: 3px;
        border-bottom-left-radius: 3px;
    }
    .btn-group, .btn-group-vertical {
        position: relative;
        display: inline-block;
        vertical-align: middle;
    }
    .btn-group-justified {
        display: table;
        width: 100%;
        table-layout: fixed;
        border-collapse: separate;
    }
    .btn-group>.btn-group {
        float: left;
    }
    .btn-group-justified>.btn, .btn-group-justified>.btn-group {
        display: table-cell;
        float: none;
        width: 1%;
    }
    .btn-group>.btn, .btn-group-vertical>.btn {
        position: relative;
        float: left;
    }
    .btn-group>.btn:hover, .btn-group-vertical>.btn:hover, .btn-group>.btn:focus, .btn-group-vertical>.btn:focus, .btn-group>.btn:active, .btn-group-vertical>.btn:active, .btn-group>.btn.active, .btn-group-vertical>.btn.active {
        z-index: 2;
    }
    .btn-group>.btn:first-child {
        margin-left: 0;
    }
    .btn-group-justified>.btn-group .btn {
        width: 100%;
    }
    .btn-group>.btn-group:first-child>.btn:last-child, .btn-group>.btn-group:first-child>.dropdown-toggle {
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
    }
    .btn-group>.btn-group:last-child>.btn:first-child {
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
    }
    .btn-group>.btn-group:not(:first-child):not(:last-child)>.btn {
        border-radius: 0;
    }

    .hljs {
        display: block;
        overflow-x: auto;
        padding: 0.5em;
        color: #333;
        background: #f8f8f8;
    }

    .hljs-comment,
    .hljs-template_comment,
    .diff .hljs-header,
    .hljs-javadoc {
        color: #998;
        font-style: italic;
    }

    .hljs-keyword,
    .css .rule .hljs-keyword,
    .hljs-winutils,
    .javascript .hljs-title,
    .nginx .hljs-title,
    .hljs-subst,
    .hljs-request,
    .hljs-status {
        color: #333;
        font-weight: bold;
    }

    .hljs-number,
    .hljs-hexcolor,
    .ruby .hljs-constant {
        color: #099;
    }

    .hljs-string,
    .hljs-tag .hljs-value,
    .hljs-phpdoc,
    .tex .hljs-formula {
        color: #d14;
    }

    .hljs-title,
    .hljs-id,
    .coffeescript .hljs-params,
    .scss .hljs-preprocessor {
        color: #900;
        font-weight: bold;
    }

    .javascript .hljs-title,
    .lisp .hljs-title,
    .clojure .hljs-title,
    .hljs-subst {
        font-weight: normal;
    }

    .hljs-class .hljs-title,
    .haskell .hljs-type,
    .vhdl .hljs-literal,
    .tex .hljs-command {
        color: #458;
        font-weight: bold;
    }

    .hljs-tag,
    .hljs-tag .hljs-title,
    .hljs-rules .hljs-property,
    .django .hljs-tag .hljs-keyword {
        color: #000080;
        font-weight: normal;
    }

    .hljs-attribute,
    .hljs-variable,
    .lisp .hljs-body {
        color: #008080;
    }

    .hljs-regexp {
        color: #009926;
    }

    .hljs-symbol,
    .ruby .hljs-symbol .hljs-string,
    .lisp .hljs-keyword,
    .tex .hljs-special,
    .hljs-prompt {
        color: #990073;
    }

    .hljs-built_in,
    .lisp .hljs-title,
    .clojure .hljs-built_in {
        color: #0086b3;
    }

    .hljs-preprocessor,
    .hljs-pragma,
    .hljs-pi,
    .hljs-doctype,
    .hljs-shebang,
    .hljs-cdata {
        color: #999;
        font-weight: bold;
    }

    .hljs-deletion {
        background: #fdd;
    }

    .hljs-addition {
        background: #dfd;
    }

    .diff .hljs-change {
        background: #0086b3;
    }

    .hljs-chunk {
        color: #aaa;
    }

        body{
            background: url(../image/common/logo.png) no-repeat center;
            background-size: contain;
            -webkit-background-size: contain;
            background-color:#FFFFFF;
        }
        body{-webkit-user-select:none;}
    </style>
</head>
<body>
<div class="panel">
    <div class="panel-body">
		<pre class="" id="codeShow">
	    </pre>
    </div>
</div>
</body>
<script src='../script/highlight.pack.js'></script>
<script type="text/javascript">

    window.apiready = function(){
        var e = document.getElementById("codeShow");

        showCode(e);
    }

    // ----------------------------

    /*  把相关代码添加到指定位置,并格式化. */
    function showCode(e){
        /* 获取传入的 module 对象. */
        var module = api.pageParam["module"];

        /* 从 script/module 读取同名文件. */
        var filePath = "widget://script/module/" + module.name + ".js";

        if("ios" != api.systemType){ // 安卓暂需要特殊处理.
            /* 同时兼容 widget 包在 wgt目录和主widget(apk) 中的情况. */
            filePath = filePath.replace("widget:/", api.wgtRootDir);
            filePath = filePath.replace("file:///android_asset/widget", "widget:/");
        }

        api.readFile({
            path: filePath
        }, function(ret, err){
            if(ret.status){
                e.innerHTML = ret.data;

                /* 代码高亮. */
                hljs.highlightBlock(e);
            }else{ // 出错了
                api.toast({
                    msg: "竟然无法读取模块数据文件!",
                    duration: 1500,
                    location: "top"
                });
            }
        });
    }
</script>
</html>